<template>
  <component :is="ele"></component>
</template>

<script>
export default {
  name: "Preview",
  data ({ $route }) {
    return {
      ele: $route.query.id ? this.$import($route.query.id) : 'div'
    }
  },
  mounted() {
    window.$view = this
  },
  methods: {
    show (opts, id = "klaus.wang") {
      this.ele = this.$import(id, opts)
    }
  }
}
</script>
